#ifndef __PTGUI_SURFACE_H__
#define __PTGUI_SURFACE_H__

typedef enum ptgui_format
{
	PTGUI_FORMAT_ARGB32,
	PTGUI_FORMAT_RGB24,
	PTGUI_FORMAT_A8,
	PTGUI_FORMAT_A1
} ptgui_format_t;

typedef struct _ptgui_surface_backend
{
	ptgui_surface_t *(*create_similar)		(void *surface, ptgui_format_t		 format,
											 int					 drawable, int			 width, int			 height);
	void (*blit)		(void *surface, ptgui_dc_t *dc, ptgui_rect_t *rect);
} ptgui_surface_backend_t;

struct ptgui_surface
{
	const ptgui_surface_backend_t	*backend;

	rt_uint32_t						refs;

	/* the surface extent */
	rt_uint16_t						w;
	rt_uint16_t						h;
};

void ptgui_surface_init(ptgui_surface_t *surface, const ptgui_surface_backend_t *backend);
void ptgui_surface_destroy(ptgui_surface_t *surface);
void ptgui_surface_blit(ptgui_surface_t *surface, ptgui_dc_t *dc, ptgui_rect_t *rect);

typedef struct _ptgui_surface_image
{
	struct ptgui_surface	base;

	ptgui_image_t			*image;
} ptgui_surface_image_t;

ptgui_surface_t *ptgui_surface_create_image(ptgui_image_t *image);


#endif	/* __PTGUI_SURFACE_H__ */